#include<stdio.h>
#include<malloc.h>
#define MAXSIZE 1000

typedef struct 
{
    int *data;
    int length;
}Sqlist;

typedef struct 
{
    int data;
    struct LNode *next;
}LNode,*Linklist;

int main()
{
    int temp;
    Sqlist Sq,*L;
    L=&Sq;
    L->data=(int *)malloc(MAXSIZE*sizeof(int));
    L->length=0;
    printf("请输入数据：");
    for(int i=0;i<MAXSIZE;i++)
    {
        scanf("%d",&temp);
        if(temp<0)   break;
        L->data[i]=temp;
        L->length++;
    }
    Linklist m,n,headm,headn;
    headm=NULL,headn=NULL;
    for(int i=0;i<L->length;i++)
    {
        if(L->data[i]>=60)
        {
            m=(Linklist)malloc(sizeof(LNode));
            m->data=L->data[i];
            m->next=headm;
            headm=m;
        }
        else
        {
            n=(Linklist)malloc(sizeof(LNode));
            n->data=L->data[i];
            n->next=headn;
            headn=n;
        }
    }
    m=headm,n=headn;
    printf("\n合格数据：");
    while(m)
    {
        printf("%d ",m->data);
        m=m->next;
    }
    printf("\n不合格数据：");
    while(n)
    {
        printf("%d ",n->data);
        n=n->next;
    }
}